/**
 * Create in 2012-4-23.
 */
package kit4j.ui.cs.swing.component;

import java.awt.Point;

import javax.swing.JMenu;


/**
 * 
 * @author MiniKnife
 * 
 */
public class WestMenu extends MenuLocator {

	private JMenu menu;

	/**
	 * @param menu
	 */
	public WestMenu(JMenu menu) {
		super();
		this.menu = menu;
	}

	/**
	 * @see kit4j.ui.cs.swing.component.MenuLocator#getMenuOrigin()
	 */
	@Override
	public Point getMenuOrigin() {
		return new Point(-getMenu().getPopupMenu().getWidth(), 0);
	}

	/**
	 * @return the menu
	 */
	public JMenu getMenu() {
		return menu;
	}

	/**
	 * @param menu
	 *            the menu to set
	 */
	public void setMenu(JMenu menu) {
		this.menu = menu;
	}

}
